package com.px.project.module.ht.service.impl;

import java.util.List;

import com.px.project.module.ht.entity.LocomotivePresetDao;
import com.px.project.module.ht.mapper.ILocomotivePresetMapper;
import com.px.project.module.ht.service.ILocomotivePresetService;
import com.px.project.module.ht.vo.LocomotivePresetVo;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import cn.hutool.core.bean.BeanUtil;
import lombok.RequiredArgsConstructor;

/**
 * 系统管理》生产调度》机车机械预置业务逻辑实现
 *
 * @author 品讯科技
 * @date 2024-08
 */
@Service
@RequiredArgsConstructor
public class LocomotivePresetServiceImpl extends ServiceImpl<ILocomotivePresetMapper, LocomotivePresetDao> implements ILocomotivePresetService {
    @Override
    public List<LocomotivePresetVo> listOfAll() {
        QueryWrapper<LocomotivePresetDao> queryWrapper = new QueryWrapper<>();
        queryWrapper.lambda().orderByAsc(LocomotivePresetDao::getId);
        List<LocomotivePresetDao> locomotivePresets = super.list(queryWrapper);
        return BeanUtil.copyToList(locomotivePresets, LocomotivePresetVo.class);
    }
}